﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <meta charset="utf-8" />
    <link href="../../Scripts/easyUI145/themes/icon.css" rel="stylesheet" type="text/css" />
    <link href="../../Scripts/easyUI145/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
     <link href="../../Scripts/bootstrap/css/css.css" type="text/css" rel="stylesheet" media="all" />
    <link href="../../Scripts/bootstrap/css/bootstrap.css" rel="Stylesheet" />
    <!-- ���ļ����Ա����ɳ����Լ�������,�����Լ��޸�,�Դﵽ������������Լ���ϵͳ���ͳһ. -->
    <script src="../../Scripts/easyUI145/jquery.min.js" type="text/javascript"></script>
    <script src="../../Scripts/easyUI145/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="../../Scripts/QueryString.js" type="text/javascript"></script>
    <script src="../../Scripts/config.js" type="text/javascript"></script>
    <script src="../../Scripts/CommonUnite.js" type="text/javascript"></script>
    <script src="../../Scripts/EasyUIUtility.js" type="text/javascript"></script>
    <script src="../../Scripts/QueryString.js" type="text/javascript"></script>
    <script src="../../Comm/Gener.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../Scripts/bootstrap/js/bootstrap.min.js"></script>
    <script src="../../Scripts/bootstrap/BootstrapUIDialog.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $("#Msg").html("����ִ�з��������Ժ�......");
            var myPK = GetQueryString("MyPK");
            var frmID = GetQueryString("FrmID");
            var workID = GetQueryString("WorkID");
            var func = new Entity("BP.Frm.MethodFunc", myPK);

            //Ҫִ��sql.
            if (func.MethodDocTypeOfFunc == 0) {
                var handler = new HttpHandler("BP.Frm.WF_CCBill");
                handler.AddUrlData();
                var data = handler.DoMethodReturnString("DoMethod_ExeSQL"); //ִ��SQLs
                $("#Msg").html(data);


               // $('#bootStrapdlg').modal('hide');
               // $('#bootStrapdlg', parent.document).remove();
                return;
            }


            //Ҫִ��script.  wangyanyan���.
            if (func.MethodDocTypeOfFunc == 1) {
                var script = func.DoMethodReturnString("Gener_MethodDoc_JavaScript");

                //��õ��ݵ�����.
                // var geEn = new Entity(func.FrmID, workID);
                //�滻script�ı���.
                //   alert(script);
                //                //Opera��FF��Chrome�ȣ�
                //                var script = document.createElement("script");
                //                script.setAttribute("type", "text/javascript");
                //                script.onload = function () {
                //                    alert("���سɹ�����");
                //                }
                //                script.setAttribute("src", scripts[i]); 
                // script = " var en =new Entity('Dict_XueShengJiBenXinXi',workID);  ";
                //script += " alert(en.OID); en.Email='zzzz';en.Update();  ";




                //ִ�����script.
                try {

                    eval(script);

                } catch (e) {
                    $("#Msg").html(e);
                   // $('#bootStrapdlg').modal('hide');
                    //$/('#bootStrapdlg', parent.document).remove();
                    return;
                }

                //��ʾ��Ϣ.
                return;
            }

            //Ҫִ��url.  wangyanyan���.
            if (func.MethodDocTypeOfFunc == 2) {

                var url = func.MethodDoc;
                if (url.indexOf('?') == -1)
                    url += "?FrmID=" + GetQueryString("FrmID") + "&WorkID=" + GetQueryString("WorkID");
                else
                    url += "&FrmID=" + GetQueryString("FrmID") + "&WorkID=" + GetQueryString("WorkID");

                //�����ϱ���Ĳ���.
                for (var i = 0; i < attrs.length; i++) {
                    var attr = attrs[i];

                    if (attr.UIContralType == 0) {
                        url += "&" + attr.KeyOfEn + "=" + $("#TB_" + attr.KeyOfEn).val();
                        continue;
                    }

                    if (attr.UIContralType == 1) {
                        url += "&" + attr.KeyOfEn + "=" + $("#DDL_" + attr.KeyOfEn).val();
                        continue;
                    }

                    if (attr.UIContralType == 2) {
                        url += "&" + attr.KeyOfEn + "=" + $("#CB_" + attr.KeyOfEn).val();
                        continue;
                    }
                    if (attr.UIContralType == 3) {
                        url += "&" + attr.KeyOfEn + "=" + $("#RB_" + attr.KeyOfEn).val();
                        continue;
                    }
                }

                //ִ��url��������.
                var data = DBAccess.RunUrlReturnString(url);

                if (func.MsgSuccess == "")
                    func.MsgSuccess = "ִ�гɹ�.";

                if (func.MsgErr == "")
                    func.MsgErr = "ִ��ʧ��.";

                if (data.indexOf('err@') == -1) {
                    
                    $("#Msg").html(func.MsgErr + "#" + data);
                    //$('#bootStrapdlg', parent.document).modal('hide');
                    //$('#bootStrapdlg', parent.document).remove();
                    return;
                }
                $("#Msg").html(data);
                //alert(data);
            }

        });

        function DoScript(func) {

        }
    </script>
</head>
<body>
<div id="Msg"></div>
</body>
</html>
